<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/index.css" rel="stylesheet" type="text/css">
</head>
<body>
<%Object merchant = session.getAttribute("merchant"); %>
	<nav class="navbar navbar-inverse navbar-fixed-top">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed"
				data-toggle="collapse" data-target="#navbar" aria-expanded="false"
				aria-controls="navbar">
				<span class="sr-only">Toggle navigation</span> <span
					class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="showHomePage">商家平台</a>

		</div>
		<div id="navbar" class="navbar-collapse collapse">
			<ul class="nav navbar-nav navbar-right">
				<li><a href="logout">注销</a></li>
			</ul>
			<form class="navbar-form navbar-right">
				<!--search-->
				<input type="text" class="form-control" placeholder="Search...">

			</form>
		</div>

	</div>
	</nav>
	<div class="container contentMin">
		<div class="row">
			<div class="col-md-12">
				<div class="row">
					<!-- 头像之类的 -->
					
					<div class="col-xs-8 col-sm-3 left-content sidebar-offcanvas"
						id="sidebar">
						<div class="list-group">
							<a href="showHomePage?mId=${merchant.mId }" class="list-group-item active">商家信息</a> <a
								href="showFoodPage" class="list-group-item">菜品管理</a>
						</div>
					</div>
					<!--/.sidebar-offcanvas-->
					<div class="col-xs-8 col-sm-9 col-md-offset-4 right-content">
						<h1>商家信息&nbsp&nbsp<span class="error title">${Error} </span></h1>
						<hr width="100%">
						<form class="form-horizontal">
							<div class="form-group">
								<label class="col-sm-2 control-label">姓名</label>
								<div class="col-sm-10">
									<p>${merchant.mPersonName }</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">电话</label>
								<div class="col-sm-10">
									<p>${merchant.mTel }</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">身份证号</label>
								<div class="col-sm-10">
									<p>${merchant.mIdCard }</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">身份证图片</label>
								<div class="col-sm-10">
									<img src="${merchant.mCardPath }" width="200" height="100">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">商家名</label>
								<div class="col-sm-10">
									<p>${merchant.mBrand }</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">状态</label>
								<div class="col-sm-10">
									   <p class="status">
									   <c:choose>
										<c:when test="${merchant.mStatus==1 }">待审核</c:when>
										<c:when test="${merchant.mStatus==2 }">已通过</c:when>
										<c:when test="${merchant.mStatus==3 }">已拉黑</c:when>
										<c:when test="${merchant.mStatus==4 }">审核未通过</c:when>
										</c:choose>
										</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">地址</label>
								<div class="col-sm-10">
									<p>${merchant.mLocation}</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">商家logo</label>
								<div class="col-sm-10">
									<img src="${merchant.mLogoPath }" width="100" height="100">
								</div>
							</div>
						</form>
						<div class="col-md-offset-2 col-md-8">
						<button class="btn btn-default" type="submit" data-toggle="modal"
								data-target="#myModal" 
								<c:if  test="${merchant.mStatus==3}">disabled="true"</c:if>
								<c:if  test="${merchant.mStatus==4}">disabled="true"</c:if>
								>修改信息</button>
						<button class="btn btn-default" type="submit" data-toggle="modal"
								data-target="#passwordModal" 
								<c:if  test="${merchant.mStatus==3}">disabled="true"</c:if>
								<c:if  test="${merchant.mStatus==4}">disabled="true"</c:if>
								>修改密码</button>
							
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 编辑模态框 -->
	<div id="myModal" class="modal fade editModal" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">修改信息</h4>
				</div>
				<form method="post" action="updateMerchant" enctype="multipart/form-data">
					<div class="modal-body">

						<div class="form-group">
							<label>店名</label> <input type="text" class="form-control"
								placeholder="输入店名" value="${merchant.mBrand }" name="mBrand">
						</div>
						<div class="form-group">
							<label>地址</label> <input type="text" class="form-control"
								placeholder="输入地址" value="${merchant.mLocation }" name="mLocation">
						</div>
						<div class="form-group">
							<label>商家logo</label><img src="${merchant.mLogoPath }" width="100" height="100"> <input type="file" class="btn btn-default"
								placeholder="输入logo" name="mLogoPath">
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="submit" class="btn btn-primary editAccount">提交</button>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="passwordModal" class="modal fade editModal" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">修改密码</h4>
				</div>
				<form method="post" action="updatePassword">
					<div class="modal-body">
						<div class="form-group">
							<label>原密码</label> <input type="password" class="form-control"
								placeholder="原密码" name="oldPassward">
						</div>
						<div class="form-group">
							<label>新密码</label> <input type="password" class="form-control"
								placeholder="新密码" name="newPassword">
						</div>
						<div class="form-group">
							<label>重新输入</label> <input type="password" class="form-control"
								placeholder="重新输入" name="newPassword2">
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
								<button type="submit" class="btn btn-primary editAccount">提交</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</html>